home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Document Effects / top-down.izs < prev    next >
Text File  |  2005-08-31  |  5KB  |  182 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Top-Down Curtain Script
  4. <!/TITLE>
  5.  
  6. <!BROWSER>FF1+ IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION>A script that opens up two "panels" (up-down) as the surfer enters the page.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>document effects<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <!-- Step 1: Insert the following into the <head> section of your page. You can change the color of the strips from yellow to another by changing all three instances of the word "yellow" to another color name: -->
  16. <style>
  17. <!--
  18. .intro{
  19. position:absolute;
  20. left:0;
  21. top:0;
  22. layer-background-color:yellow;
  23. background-color:yellow;
  24. border:0.1px solid yellow;
  25. z-index:10;
  26. }
  27. -->
  28. </style>
  29. <!-- Step 2: Finally, insert the below right after the <body> tags, before anything else. You can adjust the speed in which the curtain "draws' by changing "speed=20" in the second line to another number (greater is faster): -->
  30. <div id="i1" class="intro"></div><div id="i2" class="intro"></div>
  31. <script language="JavaScript1.2">
  32.  
  33. /*
  34. Top-Down Curtain Script- By Dynamic Drive (www.dynamicdrive.com)
  35. For full source code, installation instructions, and TOS,
  36. visit http://www.dynamicdrive.com
  37. */
  38.  
  39. var ns4=document.layers?1:0
  40. var ie4=document.all?1:0
  41. var ns6=document.getElementById&&!document.all?1:0
  42. var speed=20
  43. var temp=new Array()
  44. var temp2=new Array()
  45. if (ns4){
  46. for (i=1;i<=2;i++){
  47. temp[i]=eval("document.i"+i+".clip")
  48. temp2[i]=eval("document.i"+i)
  49. temp[i].width=window.innerWidth
  50. temp[i].height=window.innerHeight/2
  51. temp2[i].top=(i-1)*temp[i].height
  52. }
  53. }
  54. else if (ie4||ns6){
  55. var clipbottom=ns6?parseInt(window.innerHeight)/2:document.body.offsetHeight/2
  56. cliptop=0
  57. for (i=1;i<=2;i++){
  58. temp[i]=ns6?document.getElementById("i"+i).style:eval("document.all.i"+i+".style")
  59. temp[i].width=ns6?window.innerWidth-15:document.body.clientWidth
  60. temp[i].height=ns6?window.innerHeight/2:document.body.offsetHeight/2
  61. temp[i].top=(i-1)*parseInt(temp[i].height)
  62. }
  63. }
  64.  
  65. function openit(){
  66. window.scrollTo(0,0)
  67. if (ns4){
  68. temp[1].bottom-=speed
  69. temp[2].top+=speed
  70. if (temp[1].bottom<=0)
  71. clearInterval(stopit)
  72. }
  73. else if (ie4||ns6){
  74. clipbottom-=speed
  75. temp[1].clip="rect(0 auto "+clipbottom+" 0)"
  76. cliptop+=speed
  77. temp[2].clip="rect("+cliptop+" auto auto auto)"
  78. if (clipbottom<=-5){
  79. clearInterval(stopit)
  80. if (ns6){
  81. temp[1].display="none"
  82. temp[2].display="none"
  83. }
  84. }
  85. }
  86. }
  87. function gogo(){
  88. stopit=setInterval("openit()",100)
  89. }
  90. gogo()
  91.  
  92. </script>
  93.  
  94. <!-- END OF SCRIPT -->
  95. <!/SCRIPT>
  96.  
  97. <!PREVIEW>
  98. <!-- START OF SCRIPT -->
  99.  
  100. <!-- Step 1: Insert the following into the <head> section of your page. You can change the color of the strips from yellow to another by changing all three instances of the word "yellow" to another color name: -->
  101. <style>
  102. <!--
  103. .intro{
  104. position:absolute;
  105. left:0;
  106. top:0;
  107. layer-background-color:yellow;
  108. background-color:yellow;
  109. border:0.1px solid yellow;
  110. z-index:10;
  111. }
  112. -->
  113. </style>
  114. <!-- Step 2: Finally, insert the below right after the <body> tags, before anything else. You can adjust the speed in which the curtain "draws' by changing "speed=20" in the second line to another number (greater is faster): -->
  115. <div id="i1" class="intro"></div><div id="i2" class="intro"></div>
  116. <script language="JavaScript1.2">
  117.  
  118. /*
  119. Top-Down Curtain Script- By Dynamic Drive (www.dynamicdrive.com)
  120. For full source code, installation instructions, and TOS,
  121. visit http://www.dynamicdrive.com
  122. */
  123.  
  124. var ns4=document.layers?1:0
  125. var ie4=document.all?1:0
  126. var ns6=document.getElementById&&!document.all?1:0
  127. var speed=20
  128. var temp=new Array()
  129. var temp2=new Array()
  130. if (ns4){
  131. for (i=1;i<=2;i++){
  132. temp[i]=eval("document.i"+i+".clip")
  133. temp2[i]=eval("document.i"+i)
  134. temp[i].width=window.innerWidth
  135. temp[i].height=window.innerHeight/2
  136. temp2[i].top=(i-1)*temp[i].height
  137. }
  138. }
  139. else if (ie4||ns6){
  140. var clipbottom=ns6?parseInt(window.innerHeight)/2:document.body.offsetHeight/2
  141. cliptop=0
  142. for (i=1;i<=2;i++){
  143. temp[i]=ns6?document.getElementById("i"+i).style:eval("document.all.i"+i+".style")
  144. temp[i].width=ns6?window.innerWidth-15:document.body.clientWidth
  145. temp[i].height=ns6?window.innerHeight/2:document.body.offsetHeight/2
  146. temp[i].top=(i-1)*parseInt(temp[i].height)
  147. }
  148. }
  149.  
  150. function openit(){
  151. window.scrollTo(0,0)
  152. if (ns4){
  153. temp[1].bottom-=speed
  154. temp[2].top+=speed
  155. if (temp[1].bottom<=0)
  156. clearInterval(stopit)
  157. }
  158. else if (ie4||ns6){
  159. clipbottom-=speed
  160. temp[1].clip="rect(0 auto "+clipbottom+" 0)"
  161. cliptop+=speed
  162. temp[2].clip="rect("+cliptop+" auto auto auto)"
  163. if (clipbottom<=-5){
  164. clearInterval(stopit)
  165. if (ns6){
  166. temp[1].display="none"
  167. temp[2].display="none"
  168. }
  169. }
  170. }
  171. }
  172. function gogo(){
  173. stopit=setInterval("openit()",100)
  174. }
  175. gogo()
  176.  
  177. </script>
  178.  
  179. <!-- END OF SCRIPT -->
  180. <!/PREVIEW>
  181.  
  182. <!RELATED>NONE<!/RELATED>